﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

namespace ProjectSem40701.Util
{
    public class GetActiveExamID
    {
        public int ExamID()
        {
            int examID = -1;
            try
            {
                MainDataset.ExamTableAdapters.tbl_ExamTableAdapter dpExam = new
                        MainDataset.ExamTableAdapters.tbl_ExamTableAdapter();
                DataTable dttblExam = dpExam.Get_tbl_Exam_Select_All_Status_Active();

                //Neu ton tai exam voi status active
                if (dttblExam.Rows.Count > 0)
                {
                    examID = Convert.ToInt32(dttblExam.Rows[0]["ExamID"].ToString());
                }
                return examID;
            }
            catch
            {
                return -1;
            }
        }
    }
}
